home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 January & February / rerun-1986-01-02.d64 / credit cards 64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  148 lines

  1. 5 rem mod.credit card
  2. 50 poke53280,15:poke53281,15:printchr$(14)"[147]"
  3. 100 fi$="[195]redit [195]ard [198]ile":l=12
  4. 110 m$(1)="  [152][206]ext         [152][208]revious         [152][205]enu "
  5. 115 m$(2)="[152]     [163]            [163]                [163]"
  6. 120 s=25:dim cn$(s),no$(s),ed$(s),ty$(s)
  7. 130 m$(3)="[212]here are no [208][210][201][207][210] [197]ntries for [195]ategory"
  8. 140 m$(4)="[212]here are no [205][207][210][197] [197]ntries for [195]ategory"
  9. 150 cl$="                                        "
  10. 170 print""fi$"by [205]ichael [210]eich"
  11. 175 print"[152][201]nstructions? [y/n]"
  12. 180 geta$:ifa$=""then180
  13. 185 ifa$="[217]"ora$="y"thengosub6000
  14. 190 goto300
  15. 200 rem    screen locater & page header
  16. 202 rem  * * * * * * * * * * * * * * * *
  17. 210 print"";
  18. 220 ify<>0thenpoke214,y-1:print
  19. 230 poke211,x:return
  20. 240 rem
  21. 250 print"[147]":x=l:y=1:gosub200:printfi$:x=15:y=3:gosub200:print"[205]enu"
  22. 260 return
  23. 300 rem           read file
  24. 302 rem  * * * * * * * * * * * * * * * *
  25. 320 readty$:ifty$="end"then390
  26. 330 readcn$,no$,ed$,a1$,a2$
  27. 340 ifty$="[199]"thenen$(0,g)=cn$+no$+ed$+a1$+a2$:g=g+1
  28. 350 ifty$="[211]"thenen$(1,ss)=cn$+no$+ed$+a1$+a2$:ss=ss+1
  29. 360 ifty$="[207]"thenen$(2,o)=cn$+no$+ed$+a1$+a2$:o=o+1
  30. 370 goto320
  31. 380 rem
  32. 390 goto4000
  33. 400 rem               print file
  34. 402 rem  * * * * * * * * * * * * * * * *
  35. 410 print"[147]":rem print page header
  36. 420 form=x1tox2:forn=0toy1
  37. 430 cn$=left$(en$(m,n),18):no$=mid$(en$(m,n),19,19):ed$=mid$(en$(m,n),38,5)
  38. 435 a1$=mid$(en$(m,n),43,20):a2$=right$(en$(m,n),8)
  39. 440 print"":ifcn$=""then560
  40. 450 print"[152][195]ard [206]ame:   [146] "cn$:print
  41. 460 print"[152][195]ard [206]umber: [146] "no$:print
  42. 470 print"[152][197]xp. [196]ate:   [146] "ed$:print
  43. 475 print"[152][193]ddress:     [146] "a1$:printtab(15)a2$
  44. 480 x=0:y=22:gosub200:printm$(1)+m$(2)
  45. 490 k=0:geta$:ifa$=""then490
  46. 495 a=asc(a$)
  47. 500 ifa=77ora=205 thengosub250:return
  48. 503 ifa$="[208]"ora$="p"thenifc=1then565
  49. 504 ifa$="[208]"ora$="p"thenn=n-2:ifn>=-1then560
  50. 505 ifc>1thenifn<0thenx= 0:y=15:gosub200:printm$(3):fork=0to2000:next
  51. 510 ifkthenx=0:y=15:gosub200:printcl$:n=n+2:goto490
  52. 530 ifa$<>"[206]"anda$<>"n"then490
  53. 535 ifc=1thenifn+1>=y1then570
  54. 540 ifn+1>=y1thenx=0:y=15:gosub200:printm$(4):fork=0to2000:next
  55. 550 ifkthenx=0:y=15:gosub200:printcl$:goto490
  56. 560 ifc<>1then nextn
  57. 565 ifc=1thenif(a$="[208]"ora$="p")thenif(n>0 andn<=g)thenn=n-1:goto430
  58. 567 ifc=1thenif(a$="[208]"ora$="p")thenifn=0thenm=m-1:n=g:ifm>=0then430
  59. 568 ifc=1thenifm<0thenx=0:y=15:gosub200:printm$(3):fork=0to2500:next
  60. 569 ifkthenx=0:y=15:gosub200:printcl$:gosub250:return
  61. 570 ifc=1thenifn<gthennextn
  62. 572 ifc=1thenifm<>x2then nextm
  63. 575 ifc=1thenifm=x2thenx=0:y=15:gosub200:printm$(4):fork=0to2000:next:goto550
  64. 580 goto490
  65. 1000 rem              data
  66. 1003 rem *******************************                 gasoline
  67. 1005 :
  68. 1010 data"[199]","[208]hillips [208]etroleum","123-456-789-0      ",11/85
  69. 1015 data"[208][207][194]ox77,[194]artlesville","[207][203] 74004"
  70. 1020 data"[199]","[212]otal [208]etroleum   ","12345-678-90123    ","none "
  71. 1025 data"[193]lma                ","[205][201] 48801"
  72. 1030 data"[199]","[199]ulf [207]il [195]orp.    ","12345-67890        ",03/85
  73. 1035 data"                    ","        "
  74. 1099 rem *******************************                stores
  75. 1100 data"[211]","[211]ears [210]oebuck & [195]o","1-23456-78901-2    ","none "
  76. 1105 data"                    ","        "
  77. 1110 data"[211]","[202][195] [208]enney         ","123-456-789-0      ","none "
  78. 1115 data"                    ","        "
  79. 1120 data"[211]","[205]ontgomery [215]ard   ","123-456-789-0123   ","none "
  80. 1125 data"                    ","        "
  81. 1199 rem *******************************                 other
  82. 1200 data"[207]","[205]aster [195]harge-[201]owa","1234-5678-9012-3456",03/84
  83. 1205 data"[208][207][194]ox14361,[207]maha    ","[206][197] 68114"
  84. 1210 data"[207]","[201]nstant [195]ash      ","1234-5678-9012345  ","none "
  85. 1215 data"[208][207][194]ox[194]-1608,[205]inneap.","[205][206] 55480"
  86. 2099 data end
  87. 4000 rem * * * * * * * * * * * * * * * *
  88. 4002 rem             bubble sort
  89. 4010 print"[147]"tab(10)"[193]lphabetizing"
  90. 4015 print""tab(10)"[193]ll [196]ata":printtab(10)"[208]lease [215]ait"
  91. 4020 form=0to2:kk=0:n=g:ifm=1thenn=ss
  92. 4025 ifm=2thenn=o
  93. 4030 fori=0ton-1:ifen$(m,i+1)=""thenkk=kk+1:goto4140
  94. 4040 ifen$(m,i)>en$(m,i+1)thenk=1:goto4090
  95. 4050 ifen$(m,i)<=en$(m,i+1)thenk=0:goto4140
  96. 4090 t$=en$(m,i):en$(m,i)=en$(m,i+1):en$(m,i+1)=t$
  97. 4140 nexti:ifkk<>n-1then4025
  98. 4160 nextm:goto5000
  99. 5000 rem * * * * * * * * * * * * * * * *
  100. 5002 rem            menu 1
  101. 5020 gosub250
  102. 5030 x=10:y=5:gosub200:print" [211]elect: "
  103. 5040 y=7:gosub200:print"[152]1  [210]eview [198]ile":y=9:gosub200:print"[152]2  [213]pdate"
  104. 5050 y=11:gosub200:print"[152]3  [209]uit"
  105. 5060 geta$:a=val(a$):ifa<1ora>3then5060
  106. 5070 onagoto5200,5090,5100
  107. 5080 goto5060
  108. 5090 list1000-4000
  109. 5100 rem * * * * * * * * * * * * * * * *
  110. 5102 rem            quit
  111. 5110 print"[147]"chr$(142):end
  112. 5200 rem * * * * * * * * * * * * * * * *
  113. 5202 rem       review file menu (2)
  114. 5205 :
  115. 5210 print"":forx=5to11step2:printcl$:next
  116. 5220 x=10:y=5:gosub200:print"[210]eview:"
  117. 5230 y=7:gosub200:print"[152]1  [193]ll":y=9:gosub200:print"[152]2  [199]asoline"
  118. 5240 y=11:gosub200:print"[152]3  [211]tores":y=13:gosub200:print"[152]4  [207]ther"
  119. 5250 y=15:gosub200:print"[152]5  [209]uit"
  120. 5260 c=0:getc$:c=val(c$):ifc<1orc>5then5260
  121. 5270 ifc=5then5000
  122. 5280 ifc=1thenx1=0:x2=2:y1=g
  123. 5290 ifc=2thenx1=0:x2=0:y1=g
  124. 5300 ifc=3thenx1=1:x2=1:y1=ss
  125. 5310 ifc=4thenx1=2:x2=2:y1=o
  126. 5330 gosub400:goto5200
  127. 6000 rem * * * * * * * * * * * * * * * *
  128. 6002 rem            instructions
  129. 6003 rem * * * * * * * * * * * * * * * *
  130. 6010 print"[147]"fi$"-[201]nstructions"
  131. 6030 print"[196]ata for each credit card is entered"
  132. 6040 print"beginning at line 1000."
  133. 6050 print"[197]ach card has the following entries:"
  134. 6060 printtab(5)"[212]ype[152] ([199] for gasoline, [211] for [211]tore,           [207] for [207]ther)"
  135. 6070 printtab(5)"[206]ame of card[152] (up to 18 letters)"
  136. 6080 printtab(5)"[195]ard [206]umber[152] ( up to 19 numbers)"
  137. 6090 printtab(5)"[197]xpiration [196]ate[152] (up to 5 char-               acters)"
  138. 6095 printtab(5)"[193]ddress[152] (up to 39 characters in two           lines)"
  139. 6100 print"[198]or example, here is a sample entry-"
  140. 6110 cr$=chr$(34)
  141. 6120 printtab(5)"data "cr$"[199]"cr$","cr$"[195]onoco            "cr$","
  142. 6125 printtab(5)cr$"xx-xxx-xxxx        "cr$","cr$"05/85"cr$
  143. 6130 printtab(5)"data "cr$"1234 [205]ain [211]t.,[212]ampa "cr$","spc(20)cr$"[198][204] 11111"cr$
  144. 6140 print"[152][210]e-save the entire program after           entering new data"
  145. 6150 printtab(8)"[152][208]ress any key to continue"
  146. 6160 geta$:ifa$=""then6160
  147. 6170 return
  148.